﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PivotalTracker.FluentAPI.Domain;
using MantisToPivotalTracker.MantisService;

namespace MantisToPivotalTracker
{
    public class Custom
    {
       public const string MANTIS_LOGIN = "mantislogin";
       public const string MANTIS_PASSWORD = "mantispasswords";
       public const string MANTIS_PROJECT_ID = "0";
       public const string MANTIS_BASE_URL = "http://www.mantisbt.org/demo";
       public const string PIVOTAL_APIKEY = "XXXX";
       public const int PIVOTAL_PROJECT_ID = 0;


       //TODO: Must be adapted
       public static StoryTypeEnum ConvertStoryType(IssueData p)
       {
           //Category determine story type in our mantis
           switch (p.category)
           {
               case "Question":
               case "Action":
               case "Feature":
                   return StoryTypeEnum.Feature;
               case "Bug":
                   return StoryTypeEnum.Bug;
               default:
                   return StoryTypeEnum.Feature;
           }
       }

       //TODO: Must be adapted
       public static Person GetPivotalUser(string mantisName)
       {
           if (mantisName == null)
               return null;

           switch (mantisName)
           {
               case "Name1":
               case "Name2":
               case "Name3":
               case "Name5":
                   return new Person() { Name = mantisName, Email = mantisName + "@mydomain.fr" };
               default:
                   return null;
           }
       }
    }
}
